home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / OpenDoc / Interfaces / CPlusPlus / Extensn.xh < prev    next >
Encoding:
Text File  |  1997-02-13  |  4.9 KB  |  222 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: Extensn.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *  Classes defined in this interface
  13.  * 
  14.  */
  15.  
  16.  
  17. #ifndef SOM_ODExtension_xh
  18. #define SOM_ODExtension_xh
  19.  
  20. class ODExtension;
  21.  
  22. #define ODExtension_MajorVersion 1
  23. #define ODExtension_MinorVersion 0
  24.  
  25. /* C++ SOM defs */
  26. #include <somcls.xh>
  27. #include <somcm.xh>
  28.  
  29. /* C++ parent defs */
  30. #ifndef SOM_ODRefCntObject_xh
  31. #include <RefCtObj.xh>
  32. #endif
  33.  
  34. #ifndef ODExtension_API
  35. #define ODExtension_API
  36. /*
  37.  * -- The Class API
  38.  */
  39.  
  40. /*
  41.  * Start of user-defined types:
  42.  */
  43. class SOMClass;
  44. class SOMObject;
  45. class ODFrame;
  46. class ODFacet;
  47. class ODObject;
  48. class ODExtension;
  49. class ODRefCntObject;
  50.  
  51. /*
  52.  * End of user-defined types.
  53.  */
  54.  
  55. #ifdef OLDIBMSOMAPISUPPORT
  56. #define ODExtensionCClassData ODExtensionClassData
  57. #define ODExtensionNewClass(major,minor) somNewVersionedClassReference(ODExtension,major,minor)
  58. #endif
  59.  
  60. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  61. #define ODExtensionMetaClass SOMClass
  62.  
  63. #if PRAGMA_ALIGN_SUPPORTED
  64. #  pragma options align=power
  65. #endif
  66.  
  67. /* The API to the ODExtension class object, and the methods it introduces. */
  68. SOMEXTERN struct ODExtensionClassDataStructure {
  69. #ifdef OLDIBMSOMAPISUPPORT
  70.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  71. #else
  72.     long zero;
  73. #endif
  74.     somStaticClassInfo *sci;
  75.     somDToken        instanceDataToken;
  76.     long reserved [3];
  77.     somMToken InitExtension;
  78.     somMToken GetBase;
  79.     somMToken BaseRemoved;
  80.     somMToken IsValid;
  81.     somMToken CheckValid;
  82. } SOMDLINK ODExtensionClassData;
  83.  
  84. #if PRAGMA_ALIGN_SUPPORTED
  85. #  pragma options align=reset
  86. #endif
  87.  
  88. #if !defined(ODExtension_Class_Source) && !defined(SOM_Module_extensn_Source)
  89. #if PRAGMA_IMPORT_SUPPORTED
  90. #pragma import list ODExtensionClassData
  91. #endif
  92. #endif
  93.  
  94.  
  95. /*
  96.  * -- Typedefs and inline method declarations for left path inherited methods
  97.  * -- are omitted because this compilation had -museinheritedmethods in effect
  98.  */
  99.  
  100.  
  101. /*
  102.  * -- Typedefs for ODExtension Method Procedures
  103.  */
  104. SOMEXTERN {
  105. typedef void   (* SOMLINK somTD_ODExtension_InitExtension)(ODExtension *somSelf, Environment *ev,
  106.         ODObject* base);
  107. typedef ODObject*   (* SOMLINK somTD_ODExtension_GetBase)(ODExtension *somSelf, Environment *ev);
  108. typedef void   (* SOMLINK somTD_ODExtension_BaseRemoved)(ODExtension *somSelf, Environment *ev);
  109. typedef ODBoolean   (* SOMLINK somTD_ODExtension_IsValid)(ODExtension *somSelf, Environment *ev);
  110. typedef void   (* SOMLINK somTD_ODExtension_CheckValid)(ODExtension *somSelf, Environment *ev);
  111. }
  112.  
  113. #endif /* ODExtension_API */
  114.  
  115.  
  116. /*
  117.  * -- This emitter treats Method Tokens as Thunks by default.
  118.  * -- Use the sc modifier "nothunks" to change this default
  119.  */
  120. #undef somresolve_
  121. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  122.  
  123. /*
  124.  * -- The C++ Wrapper Class for ODExtension
  125.  */
  126. class ODExtension : public ODRefCntObject
  127. {
  128. public:
  129.  
  130. // ODExtension::new registers use of the class object, and then uses somNew
  131. // to allocate memory and load the object method table pointer. 
  132. void *operator new(size_t size)
  133. {
  134.     SOM_IgnoreWarning(size);
  135.     // Allocate memory using the default allocator for ODExtension, and
  136.     // clear mem & set method table pointer, call basic initialization
  137. #ifdef SOMCHKNULL
  138.     void * __somResult = (void *)
  139.       somNewObject(ODExtension);
  140.     SOMCHKNULL(__somResult);
  141.     return __somResult;
  142. #else
  143.     return (void*) somNewObject(ODExtension);
  144. #endif
  145. }
  146.  
  147. // ODExtension::delete uses the default deallocator for the object's class.
  148. void operator delete(void * obj)
  149. {
  150.     if (obj) {
  151.         SOM_Resolve(obj,SOMObject,somFree)
  152.            ( (SOMObject*) obj );
  153.     }
  154. }
  155.  
  156. /* method: InitExtension */
  157. void   InitExtension(Environment *ev,
  158.         ODObject* base)
  159. {
  160.    SOM_ResolveD(this,ODExtension,ODExtension,InitExtension)
  161.     (this,ev,base);
  162. #ifdef SOMCHKEXCEPT
  163.       SOMCHKEXCEPT;
  164. #endif
  165. }
  166.  
  167. /* method: GetBase */
  168. ODObject*   GetBase(Environment *ev)
  169. {
  170.    #ifdef SOMCHKEXCEPT
  171.    ODObject* __somResult = 
  172.       SOM_ResolveD(this,ODExtension,ODExtension,GetBase)
  173.     (this,ev);
  174.       SOMCHKEXCEPT;
  175.    return __somResult;
  176. #else
  177.    return SOM_ResolveD(this,ODExtension,ODExtension,GetBase)
  178.     (this,ev);
  179. #endif
  180. }
  181.  
  182. /* method: BaseRemoved */
  183. void   BaseRemoved(Environment *ev)
  184. {
  185.    SOM_ResolveD(this,ODExtension,ODExtension,BaseRemoved)
  186.     (this,ev);
  187. #ifdef SOMCHKEXCEPT
  188.       SOMCHKEXCEPT;
  189. #endif
  190. }
  191.  
  192. /* method: IsValid */
  193. ODBoolean   IsValid(Environment *ev)
  194. {
  195.    #ifdef SOMCHKEXCEPT
  196.    ODBoolean __somResult = 
  197.       SOM_ResolveD(this,ODExtension,ODExtension,IsValid)
  198.     (this,ev);
  199.       SOMCHKEXCEPT;
  200.    return __somResult;
  201. #else
  202.    return SOM_ResolveD(this,ODExtension,ODExtension,IsValid)
  203.     (this,ev);
  204. #endif
  205. }
  206.  
  207. /* method: CheckValid */
  208. void   CheckValid(Environment *ev)
  209. {
  210.    SOM_ResolveD(this,ODExtension,ODExtension,CheckValid)
  211.     (this,ev);
  212. #ifdef SOMCHKEXCEPT
  213.       SOMCHKEXCEPT;
  214. #endif
  215. }
  216.  
  217. };   /* ODExtension */
  218.  
  219.  
  220.  
  221. #endif       /* SOM_ODExtension_xh */
  222.